export RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static
export RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup
curl https://sh.rustup.rs -sSf >> rustinstall.sh && sh rustinstall.sh -y
/bin/zsh -c "source ~/.cargo/env"
export "PATH=\"$PATH:~/.cargo/bin\"" >> ~/.zshrc
~/.cargo/bin/rustup install stable
~/.cargo/bin/rustup default stable
echo "[source.crates-io] \n
replace-with = 'ustc' \n
[source.ustc] \n
registry = 'git://mirrors.ustc.edu.cn/crates.io-index'" >> ~/.cargo/config
~/.cargo/bin/cargo install tealdeer
~/.cargo/bin/cargo install exa
~/.cargo/bin/cargo install bat
~/.cargo/bin/cargo install zoxide
~/.cargo/bin/cargo install fd-find
~/.cargo/bin/cargo install ripgrep
~/.cargo/bin/cargo install zellij
~/.cargo/bin/tldr --update

echo "if [ \"$(command -v ~/.cargo/bin/exa)\" ]; then \n
    alias ls='exa -G  --color auto --icons -a -s type' \n
    alias ll='exa -l --color always --icons -a -s type' \n
fi \n
if [ \"$(command -v ~/.cargo/bin/bat)\" ]; then \n
    alias cat='bat -pp --theme=\"Nord\"' \n
fi \n
export RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static \n
export RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup \n" >> ~/.zshrc
echo 'eval $(~/.cargo/bin/zoxide init zsh)' >> ~/.zshrc

